package com.ycl.mapper;

import com.ycl.pojo.BlackList;
import lombok.Data;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface BlackListMapper {

    @Select("select * from y_chat_black_list where host = #{host} and ban = #{ban}")
    BlackList select(@Param("host") String host, @Param("ban") String ban);

    @Select("select * from y_chat_black_list where host = #{host}")
    List<BlackList> selectAll(@Param("host") String host);

    @Insert("INSERT INTO y_chat_black_list (host, ban, time) values ( #{b.host}, #{b.ban} , #{b.time})")
    void add(@Param("b")BlackList blackList);

    @Delete("delete from y_chat_black_list where host = #{host} and ban = #{ban}")
    void delete(@Param("host") String host,@Param("ban") String ban);
}
